package main

import (
	"fmt"
	"reflect"
)

type Student struct {
	Name  string
	Age   int
	Score float64
}

func (s Student) Info() {
	fmt.Println("Name =", s.Name, "Age =", s.Age, "Score =", s.Score)
}

//反射调用结构体方法
func main() {
	var p = Student{
		Name:  "Jim",
		Age:   10,
		Score: 99,
	}
	personValue := reflect.ValueOf(p)
	infoFunc := personValue.MethodByName("Info")
	infoFunc.Call([]reflect.Value{})
}
